
$(document).ready(function(){

		
		// Search auto complete home page manga ---------
		if( $('#menu-search-box-truyen').length ) {
				$('#menu-search-box-truyen').select2({ 
					width: 300,
					minimumInputLength: 1,
						ajax: { 
						 quietMillis: 1000,
						url: "index.php?module=ajax&act=truyen&opt=search&truyen_search_home", 
						dataType: 'json', 
								data: function (term, page){ 
									return {q: term }; 
									}, 
									results: function (data, page) {
										
										return { results: data }; 
										
									}
						}
				
				}); 
				  $("#menu-search-box-truyen").on("change", function(e) {   
								//Feed chuong
							location.href=e.val;	
							
			   
				})
		}
		// End Search auto complete home page ---------
		
})